#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>

#include <client.h>
#include <types.h>
#include <device.h>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    // qmlRegisterUncreatableMetaObject(
    //     Types::staticMetaObject,
    //     "MyApp", 1, 0,
    //     "Types",
    //     "Enum only"
    //     );

    QQmlApplicationEngine engine;
    QObject::connect(
        &engine,
        &QQmlApplicationEngine::objectCreationFailed,
        &app,
        []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);



    qmlRegisterType<Types>("MyApp", 1, 0, "Types");
    qmlRegisterType<Device>("DeviceIns", 1, 0, "DeviceIns");

    Client client;
    engine.rootContext()->setContextProperty("client", &client);

    engine.loadFromModule("EIS_Desktop", "App");

    return app.exec();
}
